<?php
/* @var $this MenuItemsController */
/* @var $model MenuItems */

$this->breadcrumbs=array(
	'Пункты Меню'=>array('admin'),
	'Управления',
);

$this->menu=array(
	array('label'=>'Создать пункт меню', 'url'=>array('create')),
);

?>

<h1>Управления меню</h1>
<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'menu-items-grid',
	'dataProvider'=>$model->search(),
	'filter'=>$model,
	'columns'=>array(
		array(
			'name' => 'name',
			'value' => '$data->parent_id>0 ? "└ ".$data->name : $data->name',
		),
		array(
			'name' => 'menu_id',
			'value'=>'CSelect::item($data->menu_id, "Menu")',
			'filter'=>CSelect::items('Menu'),
		),
		'url',
		'sort',
		array(
			'name' => 'parent_id',
			'value'=>'CSelect::item($data->parent_id, "MenuItems")',
			'filter'=>CSelect::items('MenuItems'),
		),
		array(
		  'class'=>'EButtonColumnWithClearFilters',
		  'template' => '{lock}{unlock}{update}{delete}',
			'buttons'=>array(
				'lock' => array(
					'label'=>'Заблокировать',
					'imageUrl'=>'/css/admin/images/unlock.png',
					'url'=>'Yii::app()->createUrl("/menuitems/lock",array("id"=>$data->id))',
					'visible'=>'$data->disabled==0',
				),
	
				'unlock' => array(
					'label'=>'Разблокировать',
					'imageUrl'=>'/css/admin/images/lock.png',
					'url'=>'Yii::app()->createUrl("/menuitems/unlock",array("id"=>$data->id))',
					'visible'=>'$data->disabled==1',
				),
				'update' => array(
					'imageUrl'=>'/css/admin/images/update.png',
				),
				'delete' => array(
					'imageUrl'=>'/css/admin/images/delete.png',
				),
			)
		 ),
	),
)); ?>
